#!/usr/bin/env python3
import pickle
import json

def load_result_pkl(result_path):
    """加载result.pkl文件"""
    with open(result_path, 'rb') as f:
        results = pickle.load(f)
    return results

# 加载数据
results = load_result_pkl('/disk2/xd/project/mmdetection/work_dirs/visual/result.pkl')

print("预测结果结构:")
print(f"类型: {type(results)}")
print(f"长度: {len(results)}")

if len(results) > 0:
    first_result = results[0]
    print(f"第一个元素键: {list(first_result.keys())}")
    
    if 'pred_instances' in first_result:
        pred_inst = first_result['pred_instances']
        print(f"pred_instances键: {list(pred_inst.keys())}")
        
        # 检查是否有scores字段
        if 'scores' in pred_inst:
            scores = pred_inst['scores']
            print(f"scores类型: {type(scores)}")
            print(f"scores形状: {scores.shape if hasattr(scores, 'shape') else len(scores)}")
            print(f"前10个scores: {scores[:10]}")
        else:
            print("没有找到scores字段")
            print(f"可用的字段: {list(pred_inst.keys())}") 